<?PHP

session_start();
//
$user_name = "root";
$pass_word = "haddons";
$database = "PPI";
$server = "127.0.0.1";
//
$db_handle = mysql_connect($server, $user_name, $pass_word);
$db_found = mysql_select_db($database, $db_handle);
//    
include 'i_functions.php';
//
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    $_SESSION['Trace'] = "";
//
    $DataType = $_GET['DataType'];
    $ID = $_GET['ID'];
    $_SESSION['DataType'] = $DataType;
    $DataPath = "params";
    //$_SESSION['DataType'] = "dir";
    switch ($DataType) {

        case "dir" :
            $FormID = "Params";
            $Columns = array("Param File");
            $Options = array();
            $Result = BuildDataArray($DataPath, $FormID, $Columns, $Options);
            $_SESSION['Work'] = array();
            //$Options['Action'] = "./Form.php?Form=" . $FormID . "&Title=" . $FormTitle . "&Table=" . $DataPath . "&ID=";
            $Options['Action'] = "./ParamMaint.php?DataType=txt&ID=";
            $HTML = Array2Table($xData, $Columns, $Options);
            include 'i_head.php';
            print $HTML;
            include 'i_foot.html';
            break;

        default :
            $FormID = "Params";
            $DataFile = $ID;
            $DataPath = "params/" . $DataFile;
            $Columns = array("Name", "Type", "Vals", "Val Text", "Default", "Opts", "VOpts", "SName", "Spare", "Column", "Uexit"); //default cols
            $Options = array();
            $Options['Name'] = "Form";
            $Options['DataType'] = "txt";
            $Options['AllowNew'] = "Y";
            $FormTitle = "";
            $Options['Action'] = "./Form.php?Form=" . $FormID . "&Title=" . $FormTitle . "&Table=" . $DataPath . "&ID=";
            $Result = BuildDataArray($DataPath, $FormID, $Columns, $Options);
            $_SESSION['Work'] = array();
            $HTML = Array2Table($xData, $Columns, $Options);
            include 'i_head.php';
            print $HTML;
            include 'i_foot.html';
            break;
    }
}
?>
